package com.ywj.chatroom.room;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class Client {
    public static void main(String[] args) throws IOException {
        //开启TCP客户端，设置连接的服务器IP和端口号
        Socket socket = new Socket("10.169.26.3",9999);
        System.out.println("客户端0开启");
        //返回套接字的输出流
        OutputStream os = socket.getOutputStream();
        Scanner sc = new Scanner(System.in);
        String msg = "";
        //while设置结束循环的条件
        while(!"110".equals(msg=sc.nextLine())){
            System.out.println("输入110便结束输入");
            os.write(msg.getBytes());
        }
        os.close();
        socket.close();

    }
}
